load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "storage",
    srcs = [
        "config.go",
        "paths.go",
        "server.go",
        "util.go",
    ],
    importpath = "github.com/pachyderm/pachyderm/v2/src/internal/storage",
    visibility = ["//src:__subpackages__"],
    deps = [
        "//src/cdr",
        "//src/internal/client",
        "//src/internal/dockertestenv",
        "//src/internal/errors",
        "//src/internal/grpcutil",
        "//src/internal/log",
        "//src/internal/pachconfig",
        "//src/internal/pachsql",
        "//src/internal/pctx",
        "//src/internal/pfsfile",
        "//src/internal/protoutil",
        "//src/internal/require",
        "//src/internal/storage/chunk",
        "//src/internal/storage/fileset",
        "//src/internal/storage/fileset/index",
        "//src/internal/storage/kv",
        "//src/internal/storage/track",
        "//src/internal/taskchain",
        "//src/internal/uuid",
        "//src/storage",
        "@com_github_hashicorp_golang_lru_v2//:golang-lru",
        "@dev_gocloud//blob",
        "@org_golang_google_grpc//:grpc",
        "@org_golang_google_protobuf//types/known/emptypb",
        "@org_golang_google_protobuf//types/known/wrapperspb",
        "@org_golang_x_sync//semaphore",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "storage_test",
    size = "small",
    srcs = ["server_test.go"],
    pure = "on",
    deps = [
        ":storage",
        "//src/cdr",
        "//src/internal/dockertestenv",
        "//src/internal/errors",
        "//src/internal/obj",
        "//src/internal/pachconfig",
        "//src/internal/pachd",
        "//src/internal/pctx",
        "//src/internal/randutil",
        "//src/internal/require",
        "//src/internal/storage/fileset",
        "//src/internal/storage/track",
        "//src/internal/stream",
        "//src/storage",
        "@com_github_docker_go_units//:go-units",
        "@org_golang_google_protobuf//types/known/wrapperspb",
    ],
)
